/****************************************************
 * 创建人: @author zoujian    
 * 创建时间: 2021-10-22/17:53
 * 项目名称: inquiry
 * 文件名称: InquiryMainAndResultInstReqVO.java
 * 文件描述: @Description: 批量回填综合repVO
 *
 * All rights Reserved, Designed By 投资交易团队
 * @Copyright:2016-2021
 *
 ********************************************************/
package com.springboot.func;

import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 包名称：com.win.dfbp.inquiry.vo.rep
 * 类名称：InquiryMainAndResultInstReqVO
 * 类描述：批量回填综合repVO
 * 创建人：@author zoujian
 * 创建时间：2021-10-22/17:53
 */
@Data
@ApiModel(value = "InquiryMultipleBackFillCompRepVO对象", description = "批量回填综合repVO")
public class InquiryMultipleBackFillCompRepVO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "多笔回填时，唯一的key,返回给前端使用")
    private String uniqueKey;

    public String getUniqueKey() {
        return instructionCode.concat(inquiryResultCode);
    }

    @ApiModelProperty(value = "指令编号")
    private String instructionCode;

    @ApiModelProperty(value = "交易方向")
    private String tradeDirection;

    @ApiModelProperty(value = "交易方向名称")
    private String tradeDirectionName;

    @ApiModelProperty(value = "债券内码")
    private String interCode;

    @ApiModelProperty(value = "债券简称")
    private String securitySname;

    @ApiModelProperty(value = "交易日期")
    private String tradeDate;

    @ApiModelProperty(value = "清算速度")
    private String clearingSpeed;

    @ApiModelProperty(value = "清算速度名称")
    private String clearingSpeedName;

    @ApiModelProperty(value = "结算日期")
    private String settleDate;

    @ApiModelProperty(value = "指令券面总额")
    private BigDecimal instructionFaceValue;

    @ApiModelProperty(value = "已回填券面总额（指令表）")
    private BigDecimal backfilledFaceValue;

    @ApiModelProperty(value = "询价参考收益率范围")
    private String inquiryEarningrateScope;

    @ApiModelProperty(value = "业务类型")
    private String bussinessType;

    @ApiModelProperty(value = "指令日期")
    private String instructionDate;

    @ApiModelProperty(value = "询价结果编码")
    private String inquiryResultCode;

    @ApiModelProperty(value = "对手方ID")
    private String counterpartyId;

    @ApiModelProperty(value = "对手方名称")
    private String counterpartyName;

    @ApiModelProperty(value = "交易净价")
    private BigDecimal tradeCostPrice;

    @ApiModelProperty(value = "基金经理")
    private String createUserId;

    @ApiModelProperty(value = "基金经理中文名")
    private String createUserName;

    @ApiModelProperty(value = "基金经理中文名")
    private String fundManageName;

    public String getFundManageName() {
        return createUserName;
    }

    @ApiModelProperty(value = "分配规则")
    private String distributeRule;

    @ApiModelProperty(value = "分配规则名称")
    private String distributeRuleName;

    @ApiModelProperty(value = "分配比例(%)")
    private BigDecimal distributeProportion;

    @ApiModelProperty(value = "分配过程")
    private BigDecimal distributeProgress;

    @ApiModelProperty(value = "分配结果")
    private BigDecimal distributeResult;

    public BigDecimal getDistributeResult() {
        return new BigDecimal(backfillFaceValue);
    }

    @ApiModelProperty(value = "可分配额")
    private BigDecimal distributedFaceValue;

    @ApiModelProperty(value = "待回填总额")
    private BigDecimal preBackfillFaceValue;

    @ApiModelProperty(value = "尾差承担")
    private String tailDisparityCommit;

    @ApiModelProperty(value = "尾差")
    private BigDecimal tailDisparity;

    @ApiModelProperty(value = "分配用户")
    private String distributeUser;

    @ApiModelProperty(value = "分配时间")
    @JsonFormat(
            shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date distributeTime;

    @ApiModelProperty(value="指令下达时间")
    private String inquiryTime;

    @ApiModelProperty(value = "已分户券面总额")
    private String individedFaceValue;

    @ApiModelProperty(value = "回填券面总额(回填表)")
    private String backfillFaceValue;

    public String getBackfillFaceValue() {
        if (ObjectUtil.isNull(backfillFaceValue)) {
            return "0";
        }
        return backfillFaceValue;
    }

    @ApiModelProperty(value = "优先级")
    private String priority;

    @ApiModelProperty("优先级中文")
    private String priorityName;

    @ApiModelProperty(value = "询价收益率")
    private String inquiryYield;

}
